package org.example.spring_ioc;

import org.example.spring_ioc.component.UserComponent;
import org.example.spring_ioc.configuration.UserConfiguration;
import org.example.spring_ioc.controller.UserController;
import org.example.spring_ioc.model.UserInfo;
import org.example.spring_ioc.service.UserService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;

import java.util.concurrent.Callable;

@SpringBootApplication
public class SpringIoCApplication {

    public static void main(String[] args) {
       ApplicationContext context =  SpringApplication.run(SpringIoCApplication.class, args);
        UserController userController = context.getBean(UserController.class); // 获取bean对象
        userController.sayHi(); // 使用bean对象的方法
    }
}
